package cn.broadmax.boot.util;

import java.util.Collection;
import java.util.Map;

/**
 * 断言类
 *
 * @author Jeff
 */
public final class SAssert {

    public static final String ILLEGAL_PARAMETER = ArgChecker.ILLEGAL_PARAMETER;

    public static void isTrue(boolean expression, String message, Object... args) {
        checker().isTrue(expression, message, args);
    }

    public static void isTrue(boolean expression) {
        checker().isTrue(expression);
    }

    public static void isFalse(boolean expression, String message, Object... args) {
        checker().isFalse(expression, message, args);
    }

    public static void isFalse(boolean expression) {
        checker().isFalse(expression);
    }

    public static void isNull(Object object, String message, Object... args) {
        checker().isNull(object, message, args);
    }

    public static void isNull(Object object) {
        checker().isNull(object);
    }

    public static void notNull(Object object, String message, Object... args) {
        checker().notNull(object, message, args);
    }

    public static void notNull(Object object) {
        checker().notNull(object);
    }

    public static void hasLength(String text, String message, Object... args) {
        checker().hasLength(text, message, args);
    }

    public static void hasLength(String text) {
        checker().hasLength(text);
    }

    public static void hasText(String text, String message, Object... args) {
        checker().hasText(text, message, args);
    }

    public static void hasText(String text) {
        checker().hasText(text);
    }

    public static <T> void isEmpty(T[] array, String message, Object... args) {
        checker().isEmpty(array, message, args);
    }

    public static <T> void isEmpty(T[] array) {
        checker().isEmpty(array);
    }

    public static void isEmpty(Collection<?> collection, String message, Object... args) {
        checker().isEmpty(collection, message, args);
    }

    public static void isEmpty(Collection<?> collection) {
        checker().isEmpty(collection);
    }

    public static void isEmpty(Map<?, ?> map, String message, Object... args) {
        checker().isEmpty(map, message, args);
    }

    public static void isEmpty(Map<?, ?> map) {
        checker().isEmpty(map);
    }

    public static <T> void notEmpty(T[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static <T> void notEmpty(T[] array) {
        checker().notEmpty(array);
    }

    public static void noNullElements(Object[] array, String message, Object... args) {
        checker().noNullElements(array, message, args);
    }

    public static void noNullElements(Object[] array) {
        checker().noNullElements(array);
    }

    public static void notEmpty(long[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(long[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(int[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(int[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(short[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(short[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(char[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(char[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(byte[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(byte[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(float[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(float[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(double[] array, String message, Object... args) {
        checker().notEmpty(array, message, args);
    }

    public static void notEmpty(double[] array) {
        checker().notEmpty(array);
    }

    public static void notEmpty(Collection<?> collection, String message, Object... args) {
        checker().notEmpty(collection, message, args);
    }

    public static void notEmpty(Collection<?> collection) {
        checker().notEmpty(collection);
    }

    public static void notEmpty(Map<?, ?> map, String message, Object... args) {
        checker().notEmpty(map, message, args);
    }

    public static void notEmpty(Map<?, ?> map) {
        checker().notEmpty(map);
    }

    public static void failed(String message, Object... args){
        checker().failed(message, args);
    }

    public static void failed(){
        checker().failed();
    }

    private static ArgChecker checker(){
        return ArgChecker.noI18n();
    }

}
